import 'package:enterprise_v6_app/app/core/ext/ext.dart';
import 'package:enterprise_v6_app/app/core/values/colors.dart';
import 'package:enterprise_v6_app/app/core/values/gaps.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/security_all_fundamentals_page/security_all_fundamentals_page_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';

///安全基础（我的任务）
class SecurityAllFundamentalsPagePage extends StatelessWidget {
  SecurityAllFundamentalsPagePage({super.key});

  final controller = Get.put(SecurityAllFundamentalsPageController());

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: controller.productiveList
          .map((e) => Container(
                margin: EdgeInsets.only(left: 14.w, right: 14.w, top: 12.w),
                decoration: const BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.all(
                      Radius.circular(8),
                    )),
                child: Row(
                  children: [
                    AppGaps.hGap20,
                    Expanded(
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          AppGaps.vGap16,
                          Text(
                            e.title,
                            style: TextStyle(
                              fontSize: 16.sp,
                              color: AppColors.font_color_black,
                              fontWeight: FontWeight.w500,
                            ),
                          ),
                          AppGaps.vGap16,
                          SvgPicture.asset(e.icon),
                          AppGaps.vGap16,
                        ],
                      ),
                    ),
                    SvgPicture.asset(e.image),
                    AppGaps.hGap16,
                  ],
                ),
              ).click(() {
                controller.onClickItem(e);
              }))
          .toList(),
    );
  }
}
